<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1" import="model.User, service.Util"%>
<%@ page session="true"%>
<%
	//HttpSession session = request.getSession(true);


	User u = (User) session.getAttribute("user");
	if (!Util.isLogin(u)) {
		response.sendRedirect(response.encodeURL("http://www.fiyatineydi.com"));
	}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>fiyatineydi.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- Le styles -->
<link href="css/bs.css" rel="stylesheet">
<link
	href='http://fonts.googleapis.com/css?family=Capriola&subset=latin,latin-ext'
	rel='stylesheet' type='text/css'>
<style>
body {
	padding-top: 0px;
	/* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="../assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144"
	href="ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed"
	href="ico/apple-touch-icon-57-precomposed.png">

<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<style>
.brand {
	font-family: 'Capriola', Arial, serif;
	font-weight: 400;
	font-size: 22px;
	color: #FFFFFF;
}
</style>
</head>

<body>




    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container-fluid">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="#">fiyatineydi.com</a>
          <div class="nav pull-right">
            <a class="btn"  href="#">
              <i class="icon-user"></i> <%=u.getName() %> 
              <span class="caret"></span>
            </a>
 <!--/.nav-collapse -->
        </div>
      </div>
    </div>

	  <div class="container-fluid">
 
      <div class="row-fluid" id="container">
		<a class="btn btn-primary btn-large" href="#" id="yeni"><i
			class="icon-plus icon-white"></i>Yeni Ekle</a>
</div>
	</div>
	<!-- /container -->


	<script type="text/javascript">
		$(document).ready(function() {
			$.ajax({
				type : 'GET',
				url : 'liste',
				data : 't=' + new Date().getTime(),
				success : function(ajaxCevap) {
					$('#container').html(ajaxCevap);
				}
			});
		});

		$('#yeni').live('click', function() {
			$.ajax({
				type : 'GET',
				url : 'view/fiyat_form.jsp',
				data : 't=' + new Date().getTime(),
				success : function(ajaxCevap) {
					$('#container').html(ajaxCevap);
				}
			});
		});

		$('#addFiyat').live('click', function() {
			//alert("FiyatEkle");
			$.post('FiyatEkle', $("#newFiyat").serialize());

			//to index
			$.ajax({
				type : 'GET',
				url : 'liste',
				data : 't=' + new Date().getTime(),
				success : function(ajaxCevap) {
					$('#container').html(ajaxCevap);
				}
			});

			//$('#message').html("test 1 2 3");
			//$.post("#newFiyat");

		});

		$('#index').live('click', function() {
			$.ajax({
				type : 'GET',
				url : 'liste',
				data : 't=' + new Date().getTime(),
				success : function(ajaxCevap) {
					$('#container').html(ajaxCevap);
				}
			});
		});
	</script>
</body>
</html>